<?php
register_sidebars(1);

add_filter('the_excerpt', 'excerpt_filter');
function excerpt_filter($ex) {
	return str_replace('<br />', '', $ex);
}

function wp_comments_list($comments){
	foreach($comments as $comment){
		$parent = $comment->comment_parent;
		$list[$parent][] = $comment;
	}
	wp_comments_list_show($list);
}

function wp_comments_list_show($list, $parent = 0, $depth = 1){
	foreach($list[$parent] as $comment){
		global $comment;
?>
	<li id="comment-<?php comment_ID(); ?>" class="comment depth-<?php echo $depth; ?>">
		<div id="div-comment-<?php comment_ID(); ?>">
			<div class="gravatar"><?php echo get_avatar(get_comment_author_email(), 45); ?></div>
			<div class="comment_author">#<?php echo $i . '&nbsp;'; comment_author_link(); ?></div>
			<div class="comment_date"><?php comment_date(); ?></div>
			<div class="comment_content"><?php comment_text(); ?></div> 
		</div>
	<?php if(!empty($list[get_comment_ID()])) { ?>
		<ul class="children">
		<?php //wp_comments_list_show($list, get_comment_ID(), $depth+1); ?>
		</ul>
	<?php } ?>
	</li>
<?php	
	}
}

function trim_text($text) {
	if ( '' != $text ) {
		$text = strip_tags($text);
		$excerpt_length = 20;
		$words = explode(' ', $text, $excerpt_length + 1);
		if (count($words) > $excerpt_length) {
			array_pop($words);
			array_push($words, '[...]');
			$text = implode(' ', $words);
		}
	}
	return $text;
}
?>